<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	accountNm		= Request("findAccountNm")
	part			= Request("findPart")

	
	SQLTitle = "-- ■■■■ 계정정보 관리 그리드 List up ■■■■"
	
	'## 검색조건에 따른 조건절 만들기 
	If accountNm <> "" Then 
		addSql = " accountNm LIKE '%" & accountNm & "%' "
	End If 
	If part <> "" Then 
		If addSql <> "" Then addSql = addSql & " AND " End If 
		addSql = addSql & " part ='" & part & "' "
	End If 
	If addSql <> "" Then 
		addSql = " WHERE " & addSql 
	End If 

	SQL = "SELECT accountCd, accountNm, part, accGroup, flag FROM tblAccount " & addSql & " ORDER BY part, flag DESC, accountNm" 

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<Articles>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
		
			Response.write "	<ArticleList>" & vbcrlf
				Call mkXMLNode("accountCd", rs("accountCd"), 2)
				Call mkXMLNode("accountNm", rs("accountNm"), 2)
				Call mkXMLNode("part", rs("part"), 2)
				Call mkXMLNode("accGroup", rs("accGroup"), 2)
				Call mkXMLNode("flag", rs("flag"), 2)
			Response.write "	</ArticleList>" & vbcrlf

		Rs.movenext
		Loop 
	End If
	Response.write "</Articles>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>